using Boo.Lang;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;

[Serializable]
public class spinarcadeAI : MonoBehaviour
{
	[Serializable]
	[CompilerGenerated]
	internal sealed class _0024destroy_0024475 : GenericGenerator<WaitForSeconds>
	{
		internal spinarcadeAI _0024self__0024478;

		public _0024destroy_0024475(spinarcadeAI self_)
		{
			_0024self__0024478 = self_;
		}

		public override IEnumerator<WaitForSeconds> GetEnumerator()
		{
			return new _0024(_0024self__0024478);
		}
	}

	private Rigidbody body;

	private int state;

	public int spinvelocity;

	private float[] spinspeed;

	public int movespeed;

	public int rotationSpeed;

	private float speed;

	private SmoothFollow cam;

	private Rigidbody player;

	private score score;

	private float scoreMultiplier;

	[HideInInspector]
	public int spinAdd;

	public spinarcadeAI()
	{
		spinvelocity = 1000;
		spinspeed = new float[12];
		movespeed = 16;
		rotationSpeed = 10;
	}

	public void Start()
	{
		spinspeed[0] = 580f;
		spinspeed[1] = 560f;
		spinspeed[2] = 555f;
		spinspeed[3] = 535f;
		spinspeed[4] = 460f;
		spinspeed[5] = 450f;
		spinspeed[6] = 435f;
		spinspeed[7] = 420f;
		spinspeed[8] = 395f;
		spinspeed[9] = 285f;
		spinspeed[10] = 260f;
		spinspeed[11] = 100f;
		spinvelocity = (int)(spinspeed[UnityEngine.Random.Range(0, spinspeed.Length)] + (float)UnityEngine.Random.Range(10, 100));
		body = GetComponent<Rigidbody>();
		movespeed = 16;
		body.maxAngularVelocity = 330f;
		body.AddRelativeTorque(0f, spinvelocity, 0f);
		if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name.Contains("MP"))
		{
			player = GameObject.Find("PlayerPrefab(Clone)").GetComponent<Rigidbody>();
		}
		else
		{
			player = GameObject.Find("knight dranzer").GetComponent<Rigidbody>();
		}
		score = (GameObject.Find("Score").GetComponent("score") as score);
	}

	public void mfunc()
	{
		if (!(body.angularVelocity.sqrMagnitude >= 10f))
		{
			StartCoroutine(destroy());
			CancelInvoke();
			state = 0;
		}
	}

	public IEnumerator destroy()
	{
		return new _0024destroy_0024475(this).GetEnumerator();
	}

	public void Main()
	{
		InvokeRepeating("mfunc", 1f, 0.7f);
	}
}
